Cache memory is often included in processing systems in order to increase memory accessing efficiency and speed. As is known, cache structures are often limited in size and therefore multiple memory addresses within the memory addressing space are mapped to the same address within the cache structure. Set associative caches are sometimes known to include multiple ways, or sets, that are used to cache different sets of memory locations. For example, the four way cache illustrated in FIG. 1 includes four separate sets. Each of the sets may be used to cache a different portion of the memory addressing space.
In some applications, different elements being processed may be characterized by a number of parameters. It may be efficient to treat each of these sets of parametric data as stream data, where stream data is accessed with unique memory instructions such that the stream data accesses are distinguishable from normal memory accesses. In one example, primitives in a video graphics processing system are characterized by a number of parameters including color, vertex coordinates, and possibly texture mapping information. Each of these different types of parametric data is stored as stream data and is accessed through stream data memory commands.
Because of the way stream data is accessed, prior art systems often allocated a particular set, or way, within a caching structure to stream data. A stream set illustrated in FIG. 1 may be such a set utilized for caching stream data. Allocating a particular set to stream data helps to ensure that stream data does not interfere with the caching of other types of data within the cache, which may result in inefficient cache usage.
Although the caching structure illustrated in FIG. 1 may perform adequately in applications where a single stream is supported, if multiple streams are supported in a system cache, cache "thrashing" may result as the different streams replace each other in the cache. When cache thrashing occurs, cached data is replaced before it can be effectively utilized by the processing system. Data stored in the cache is typically fetched in blocks, and such block fetching of stream data increases the likelihood of cached data being prematurely overwritten. Cache thrashing greatly reduces the benefits of including a cache in the system and can have a detrimental effect on overall system performance.
Therefore, a need exists for a method and apparatus for supporting multiple streams in a processing system that includes a cache structure.